import { Args, Query, Resolver } from '@nestjs/graphql';
import { AccountEntity } from 'src/modules/system/account/entities/account.entity';
import { LoginInput } from '../../dto/login.input';
import { LoginService } from '../../services/login/login.service';

@Resolver()
export class LoginResolver {
  constructor(
    private readonly loginService:LoginService,
  ) {}

  @Query(type => AccountEntity!, {nullable: false, description: '登录'})
  async login(
    @Args('data') loginInput: LoginInput,
  ):Promise<AccountEntity> {
    return await this.loginService.login(loginInput);
  }
}

